<template>
    <div ref="body">
        <Form :label-width="120" inline>
            <Form-item label="推送状态:">
                <Select v-model="queryParam.push_type" placeholder="请选择推送状态" style="width:200px" clearable>
                    <Option value="1" key="1">推送成功</Option>
                    <Option value="0" key="0">推送失败</Option>
                </Select>
            </Form-item>
            <Form-item label="受理人名称:">
                <Input v-model="queryParam.user_name" placeholder="请输入受理人名称" style="width:200px"/>
            </Form-item>
            <Form-item label="申请人名称:">
                <Input v-model="queryParam.applyer_name" placeholder="请输入申请人名称" style="width:200px"/>
            </Form-item>
            <Form-item label="申请人证件号:">
                <Input v-model="queryParam.applyer_certnum" placeholder="请输入申请人证件号" style="width:200px"/>
            </Form-item>
            <Form-item label="事项类型:">
                <Select v-model="queryParam.matter_type" placeholder="请选择事项类型" style="width:200px" clearable>
                    <Option value="1" key="1">事件受理</Option>
                    <Option value="2" key="2">事件过程</Option>
                    <Option value="3" key="3">事件办结</Option>
                </Select>
            </Form-item>
            <Form-item label="推送时间:">
                <DatePicker type="daterange" split-panels v-model="queryParam.pushTime"
                            placeholder="请选择推送时间" style="width: 220px" clearable  :editable="false"></DatePicker>
            </Form-item>
            <Row class="button_row">
                <span style="float: right;">
                 <Button type="primary" @click="searchQueryNew">查询</Button>
                 <Button type="primary" class="button_item_left" @click="searchReset">重置</Button>
                </span>
            </Row>
        </Form>

        <div class="table_div">
            <vxe-table border
                       resizable
                       row-id="id"
                       :row-key="true"
                       show-overflow="tooltip"
                       align="center"
                       header-align="center"
                       ref="xTree"
                       :loading="Loading"
                       :radio-config="{highlight: true}"
                       class="mytable-style"
                       :data="tableData">
                <vxe-table-column field="logBpmId" title="办件标识" align="center" width="300"/>
                <vxe-table-column field="applyerName" title="申请人名称" align="center" width="100"/>
                <vxe-table-column field="applyerCertNum" title="申请人证件号" align="center" width="200"/>
                <vxe-table-column field="applyerPhone" title="申请人电话" align="center" width="150"/>
                <vxe-table-column field="userName" title="受理人名称" align="center" width="140"/>
                <vxe-table-column field="pushTimes" title="推送次数" align="center" width="100"/>
                <vxe-table-column field="pushType" title="推送状态" align="center" width="100" :formatter="renderPushType"/>
                <vxe-table-column field="processName" title="过程名称" align="center" width="140"/>
                <vxe-table-column field="matterName" title="事项类型" align="center" width="140"/>
                <vxe-table-column field="pushDate" title="推送时间" align="center" width="200"
                                  :formatter="renderDetailTime"/>
                <vxe-table-column title="操作" align="center" width="140" fixed="right">
                    <template #default="{row}">
                        <Button type="default" @click="searchDetail(row)">查看详情</Button>
                    </template>
                </vxe-table-column>
            </vxe-table>
            <Page :total="dataCount" :page-size="pageSize" show-total class="paging"
                  @on-change="handleTableChange" :current="pageNo"></Page>
        </div>
        <detail ref="modal"/>
    </div>
</template>

<script>
    import {CommonMixin} from '@/views/common/js/CommonMixin'
    import detail from './modules/detail'

    export default {
        name: "ss00009list",
        components: {detail},
        mixins: [CommonMixin],
        data() {
            return {
                queryParam: {},
                Loading: false,
                url: {
                    list: "/api/ac/subsistence/ss00009ServiceImpl/page",
                },
            }
        },
        methods: {
            renderPushType(h) {
                if (h.cellValue == 0) {
                    return "失败";
                } else {
                    return "成功";
                }
            },
            searchDetail(row) {
                var width = this.$refs.body.clientWidth;
                this.$refs.modal.edit(row);
                this.$refs.modal.width = width + 40;
                this.$refs.modal.key = this.uuid();
            },
            searchQueryNew() {
                var time = this.queryParam.pushTime;
                if (time) {
                    if (time[0]) {
                        this.queryParam.pushTime_begin = this.DateFormat(time[0], 'YYYY-MM-DD') + " 00:00:00";
                    }
                    if (time[1]) {
                        this.queryParam.pushTime_end = this.DateFormat(time[1], 'YYYY-MM-DD') + " 23:59:59";
                    }
                }
                this.loadData(1);
            },
        },
        created() {
            this.loadData();
        }
    }
</script>

<style scoped>

</style>
